﻿using Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace IRepository
{
    public interface IProjectRepository
    {
        IList<Project> ListProjectByRole(APPRole createType, int topNumber);
        ProjectContract CreateProjectContract(ProjectContract obj);
        ProjectData CreateProjectData(ProjectData obj);
        ProjectContract GetProjectContract(int contractid);
        ProjectContract GetProjectContract(int projectID, int contractorID);
        ProjectData GetProjectData(int dataid);
        ProjectData GetProjectData(int id, ProjectDataType type, FieldName name);
        ProjectData GetProjectData(int projectID, int contractID, FieldName name);
        IList<ProjectContract> ListProjectContract(int projectID, CommonStatus status);
        ModelList<IDictionary<string, string>> ListContractByStatus(int creatorID, CommonStatus status, int start, int limit);
        ModelList<IDictionary<string, string>> ListContractByStatus(int creatorID, IList<CommonStatus> status, int start, int limit);
        ModelList<IDictionary<string, string>> ListSponsorContract(int contractorID, IList<CommonStatus> status, int start, int limit);
        ModelList<IDictionary<string, string>> ListContractByAgent(int agentID, IList<CommonStatus> status, int start, int limit);
        int GetContractNumber(int projectID, CommonStatus status = CommonStatus.All);
        IList<IDictionary<string, string>> ListSponsorMessage();
        IList<IDictionary<string, string>> ListAgentSponsorMessage();
        IList<ProjectData> ListProjectData(int id, ProjectDataType type);
        void UpdateProjectContract(ProjectContract obj);
        void UpdateProjectData(ProjectData obj);
        void DeleteProjectData(int id, ProjectDataType type);

        void CreateProjectCollection(ProjectCollection obj);
        void DeleteProjectCollection(int collectionID);
        ProjectCollection GetProjectCollection(int collectionID);
        ProjectCollection GetProjectCollection(int userID, int projectID);
        IList<ProjectCollection> ListProjectCollection(int userID);
        ModelList<IDictionary<string, string>> ListProjectCollection(int userID, int start, int limit);
        int CountProjectCollection(int projectID);

        ModelList<Project> Search(IDictionary<SearchKey, string> dicCondition, int start, int limit);
        ModelList<Project> ListProjectByBelongID(int belongID, int start, int limit);
        int CountProjectCreatedPerDay(int userID);
        ProjectSearch CreateProjectSearch(ProjectSearch obj);
        void UpdateProjectSearch(ProjectSearch obj);
        void DeleteProjectSearch(string code);
    }
}
